<template>
  <div class="box">
     <div class="box-header">
       <div class="box-left">
         {{title}}
       </div>
        <div class="box-right">
          <el-button @click="cancel">取消</el-button>
          <el-button @click="save" type="primary">保存</el-button>
        </div>
     </div>
     <div class="box-content">
         <slot></slot>
     </div>

  </div>

</template>

<script>
export default {
  props: {
    title: {
      type: String
    }
  },
  methods: {
    cancel() {
      this.$router.go(-1)
    },
    save() {
      this.$emit('save')
    }
  }

}
</script>

<style lang="scss" scoped>

.box-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(215, 215, 215, 1);
  padding:20px ;
  .box-left{
      font-family: 'Arial Negreta', 'Arial Normal', 'Arial', sans-serif;
    font-weight: 700;
    font-style: normal;
    font-size: 20px;
    color: #333;
}
}
.box-content{
  margin-top: 20px;
}

</style>
